package mx.com.matersys.vacs.domain;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.TableGenerator;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;
import javax.validation.constraints.NotNull;

import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.roo.addon.entity.RooEntity;
import org.springframework.roo.addon.javabean.RooJavaBean;
import org.springframework.roo.addon.tostring.RooToString;

@RooJavaBean
@RooToString
@RooEntity(versionField = "", table = "user_vacs")
public class UserVacs implements Serializable {
	
	/**
	 * 
	 */
	@Transient
	private static final long serialVersionUID = 1L;

	@Id
	@TableGenerator(name="GEN_USER_VACS", table="sequence", pkColumnName="SEQ_NAME", valueColumnName="SEQ_COUNT", pkColumnValue="SEQ_USER_VACS", allocationSize=1)
	@GeneratedValue(strategy=GenerationType.TABLE, generator="GEN_USER_VACS")
    @Column(name = "username", length = 20)
    private String username;
	
	@ManyToOne(optional = false)
    @JoinColumn(name = "idestatus", referencedColumnName = "idestatus")
    private Estatus idestatus;
    
    @ManyToOne
    @JoinColumn(name = "idrol", referencedColumnName = "idrol")
    private Rol idrol;
    
    @Column(name = "apmaterno", length = 30)
    private String apmaterno;
    
    @Column(name = "appaterno", length = 30)
    private String appaterno;
    
    @Column(name = "lastupdate")
    @Temporal(TemporalType.TIMESTAMP)
    @DateTimeFormat(style = "M-")
    private Date lastupdate;
    
    @Column(name = "nombre", length = 25)
    private String nombre;
    
    @Column(name = "passwd", length = 20)
    private String passwd;
    
    @Column(name = "idusuario", length = 45)
    @NotNull
    private int idusuario;
    
    @Column(name = "isespecialista")
    @NotNull
    private Short isespecialista;
    
}
